﻿#include<iostream>
#include<list>
using namespace std;


int main()
{

	/*int ar[] = { 0,1, 2, 3, 4,  5, 6, 7, 8, 9 };

	int n = sizeof(ar) / sizeof(int);

	list<int> mylist(ar, ar + n);

	list<int>::iterator pos = find(mylist.begin(), mylist.end(), 5);

	reverse(mylist.begin(), pos);

	reverse(pos, mylist.end());

	list<int>::const_reverse_iterator crit = mylist.crbegin();

	while (crit != mylist.crend())

	{

		cout << *crit << " ";

		++crit;

	}
	cout << endl;*/


	
		std::list<double> first, second;

		first.push_back(3.1);
		first.push_back(2.2);
		first.push_back(2.9);

		second.push_back(3.7);
		second.push_back(7.1);
		second.push_back(1.4);

		first.sort();
		second.sort();

		first.merge(second);
		for (std::list<double>::iterator it = first.begin(); it != first.end(); ++it)
			std::cout << ' ' << *it;
		std::cout << '\n';
	return 0;
}